package config

import (
	"fmt"
	"github.com/spf13/viper"
	"log"
)

type MysqlConf struct {
	Name string `yaml:"Name"`
	Pwd  string `yaml:"Pwd"`
}

var M MysqlConf

func init() {
	p := "/Users/fatboss/gowork/src/bw-renting/config/dev.yaml"
	viper.SetConfigFile(p)
	err := viper.ReadInConfig()
	if err != nil {
		fmt.Println("xxx", err.Error())
	}
	M.Name = viper.GetString("MysqlConf.Name")
	M.Pwd = viper.GetString("MysqlConf.Pwd")
	log.Println(M)
}
